package com.ssy.lingxi.report.model.vo.convert;

import com.ssy.lingxi.common.utils.DateUtil;
import com.ssy.lingxi.report.api.enums.CommonBooleanEnum;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *  会员订单结算CVO（转DO用，针对不同服务字段调整后，造成字段类型不一致问题）
 * @author ds
 * @version 2.0.0
 * @date 2021/3/30 14:06
 */
public class MemberOrderSettlementCVO implements Serializable {

    private static final long serialVersionUID = -4081318150053480702L;
    /**
     * ID
     */
    private Long id;

    /**
     * 结算id
     */
    private Long settlementId;

    /**
     * 单据号
     */
    private String orderNo;

    /**
     * 单据摘要
     */
    private String orderAbstract;

    /**
     * 单据类型：1-订单，2-退货申请单
     */
    private Integer orderType;

    /**
     * 订单类型：1.询价采购 2.需求采购 3.现货采购 4.集采   5.渠道直采 6.渠道现货 7.积分兑换 8.渠道积分兑换
     */
    private Integer type;

    /**
     * 单据时间
     */
    private Long orderTime;
    /**
     * 单据时间(对应db)
     */
    private LocalDateTime orderTimeTemp;

    /**
     * 订单金额
     */
    private Double orderAmount;

    /**
     * 支付次数
     */
    private Integer payCount;
    /**
     * 支付金额
     */
    private Double payAmount;
    /**
     * 支付时间
     */
    private Long payTime;
    /**
     * 支付时间(对应db)
     */
    private LocalDateTime payTimeTemp;

    /**
     * 结算金额
     */
    private Double settlementAmount;

    /**
     * 结算会员id
     */
    private Long memberId;

    /**
     * 结算角色id
     */
    private Long roleId;

    /**
     * 付款会员id
     */
    private Long payMemberId;

    /**
     * 付款角色id
     */
    private Long payRoleId;

    /**
     * 关联数据id
     */
    private Long dataId;

    /**
     * 是否含税：0=否；1=是;
     */
    private Integer isHasTax;
    /**
     * 是否含税：CommonBooleanEnum
     */
    private Boolean isHasTaxTemp;

    /**
     * 税率
     */
    private Double taxRate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSettlementId() {
        return settlementId;
    }

    public void setSettlementId(Long settlementId) {
        this.settlementId = settlementId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderAbstract() {
        return orderAbstract;
    }

    public void setOrderAbstract(String orderAbstract) {
        this.orderAbstract = orderAbstract;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getOrderTime() {
        if(orderTime==null&&orderTimeTemp!=null){
            orderTime= DateUtil.convertToTimeMillis(orderTimeTemp);
        }
        return orderTime;
    }

    public void setOrderTime(Long orderTime) {
        this.orderTime = orderTime;
    }

    public LocalDateTime getOrderTimeTemp() {
        return orderTimeTemp;
    }

    public void setOrderTimeTemp(LocalDateTime orderTimeTemp) {
        this.orderTimeTemp = orderTimeTemp;
    }

    public Double getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(Double orderAmount) {
        this.orderAmount = orderAmount;
    }

    public Integer getPayCount() {
        return payCount;
    }

    public void setPayCount(Integer payCount) {
        this.payCount = payCount;
    }

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Long getPayTime() {
        if(payTime==null&&payTimeTemp!=null){
            payTime= DateUtil.convertToTimeMillis(payTimeTemp);
        }
        return payTime;
    }

    public void setPayTime(Long payTime) {
        this.payTime = payTime;
    }

    public LocalDateTime getPayTimeTemp() {
        return payTimeTemp;
    }

    public void setPayTimeTemp(LocalDateTime payTimeTemp) {
        this.payTimeTemp = payTimeTemp;
    }

    public Double getSettlementAmount() {
        return settlementAmount;
    }

    public void setSettlementAmount(Double settlementAmount) {
        this.settlementAmount = settlementAmount;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getPayMemberId() {
        return payMemberId;
    }

    public void setPayMemberId(Long payMemberId) {
        this.payMemberId = payMemberId;
    }

    public Long getPayRoleId() {
        return payRoleId;
    }

    public void setPayRoleId(Long payRoleId) {
        this.payRoleId = payRoleId;
    }

    public Long getDataId() {
        return dataId;
    }

    public void setDataId(Long dataId) {
        this.dataId = dataId;
    }

    public Integer getIsHasTax() {
        if(isHasTax==null&&isHasTaxTemp!=null){
            isHasTax=isHasTaxTemp? CommonBooleanEnum.YES.getCode() : CommonBooleanEnum.NO.getCode();
        }
        return isHasTax;
    }

    public void setIsHasTax(Integer isHasTax) {
        this.isHasTax = isHasTax;
    }

    public Boolean getIsHasTaxTemp() {
        return isHasTaxTemp;
    }

    public void setIsHasTaxTemp(Boolean hasTaxTemp) {
        isHasTaxTemp = hasTaxTemp;
    }

    public Double getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(Double taxRate) {
        this.taxRate = taxRate;
    }
}
